<template>
	<view class="container">
		<navbar :title='pageType == 0 ? "隐私政策":"代理商协议"'></navbar>
		<view class="wrap" v-if='pageType == 0'>
			<uv-parse :content="privacyPolicy"></uv-parse>
		</view>
		<view class="wrap" v-else>
			<uv-parse :content="disContent"></uv-parse>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				privacyPolicy:'',
				serviceAgreement:'',
				disContent:'',
				pageType:0,
			};
		},
		onLoad(option) {
			this.pageType = option.type ? option.type:0;
			this.getProtocol()
		},
		methods:{
			getProtocol(){
				let api = this.pageType == 0 ? app.getApi().baseApi.protocol : app.getApi().promotion.shareAgree
				app.globalRequest({
					api,
				}).then(res=>{
					if(res.code == 0){
						if(this.pageType == 0){
							this.privacyPolicy = res.data.privacy_policy;
						}else{
							this.disContent = res.data;
						}
					}
				})
			}
		}
		
	}
</script>

<style lang="scss" scoped>
	.wrap{
		padding:24rpx;
	}
</style>
